//
//  YTHomeCollectionCell.m
//  CllForIOS
//
//  Created by qiyun on 2018/3/6.
//  Copyright © 2018年 aRui. All rights reserved.
//

#import "YTHomeCollectionCell.h"

@interface YTHomeCollectionCell()

@end

@implementation YTHomeCollectionCell
- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
      [self makeUI];
    }
    return self;
}
- (void)makeUI{
 
    _iconView = [[UIImageView alloc]init];
    _iconView.contentMode=UIViewContentModeBottomLeft;
    [self.contentView addSubview:_iconView];
    
    _titleLabel = [[UILabel alloc]init];
    _titleLabel.textColor =RGBA(94, 94, 94);
    _titleLabel.font =KFONT_medium(11);
    _titleLabel.textAlignment=NSTextAlignmentCenter;
    [self.contentView addSubview:_titleLabel];
    
}
    // 重写layoutSubviews，给自己内部子控件设置frame
- (void)layoutSubviews
{
   [super layoutSubviews];
    CGFloat iconViewW = AfW(50);
    CGFloat iconViewH = AfW(58);
    if (SCREEN_H <= 568.0) {
         iconViewW = AfW(50);
         iconViewH = AfW(67);
    }
    
    CGFloat iconViewY = 0;
    CGFloat iconViewX = (SCREEN_W/4-iconViewW)/2;
    _iconView.frame= CGRectMake(iconViewX, iconViewY, iconViewW, iconViewH);



    CGFloat titleW = SCREEN_W/4;
    CGFloat titleH = AfW(11);
    CGFloat titleY =AfW(80)-AfW(11);
    CGFloat titleX = 0;
    _titleLabel.frame= CGRectMake(titleX, titleY, titleW, titleH);


}

@end
